class AddAddressToOrders < ActiveRecord::Migration
  def self.up 
    add_column :orders, :contact_first_name, :string
    add_column :orders, :contact_surname, :string
    add_column :orders, :contact_email, :string

    add_column :orders, :address_city, :string
    add_column :orders, :address_street, :string
    add_column :orders, :address_house_number, :integer
    add_column :orders, :address_house_number_addition, :string
    add_column :orders, :address_postal_code, :string
    add_column :orders, :address_telephone_number, :string
    add_column :orders, :address_mobile_number, :integer
    add_column :orders, :address_fax_number, :string
    add_column :orders, :address_company, :string

    add_column :order_items, :shipped_quantity, :integer
    remove_column :order_items, :current_price
    add_column :order_items, :original_price, :float
  end

  def self.down
    remove_column :orders, :contact_first_name
    remove_column :orders, :contact_surname
    remove_column :orders, :contact_email

    remove_column :orders, :address_city
    remove_column :orders, :address_street
    remove_column :orders, :address_house_number
    remove_column :orders, :address_house_number_addition
    remove_column :orders, :address_postal_code
    remove_column :orders, :address_telephone_number
    remove_column :orders, :address_mobile_number
    remove_column :orders, :address_fax_number
    remove_column :orders, :address_company

    remove_column :order_items, :shipped_quantity
    add_column :order_items, :current_price, :float
    remove_column :order_items, :original_price
  end
end
